/**
 * @description: 获取search配置信息
 * @return {Array<CommonSearch.SearchOption>}
 */
export const useSearchOption = (): Array<CommonSearch.SearchOption> => {
  const startDate: CommonSearch.SearchOption = {
    label: "创建时间",
    key: "startDate",
    realKeys: ["startDate", "endDate"],
    value: [],
    type: "datetimerange",
    span: 6
  };

  const area: CommonSearch.SearchOption = {
    label: "区域",
    key: "area",
    value: "",
    type: "select",
    typeCode: { value: "OPPORTUNITY_AREA", typeCode: "ENTS" },
    placeholder: "请选择区域"
  };

  const kind: CommonSearch.SearchOption = {
    label: "能源种类",
    key: "kind",
    value: "",
    type: "select",
    typeCode: { value: "OPPORTUNITY_ENERGY_KIND", typeCode: "ENTS" },
    placeholder: "请选择能源种类"
  };

  return [startDate, area, kind];
};

/**
 * @description:  获取table表格的表头（cloumns）信息
 * @param {boolean} flag
 * @return {*}
 */
export const useTableCloumns = (cb?: (scope: any) => void): Array<CommonTable.TableCloumnsType> => {
  const o_1 = { label: "区域", prop: "area" };
  const o_2 = { label: "工序/系统", prop: "process" };
  const o_3 = { label: "设备/管理", prop: "device" };
  const o_4 = { label: "能源种类", prop: "kind" };
  const o_5 = { label: "节能机会", prop: "opportunity", width: 150 };
  const o_6 = { label: "能源管理环节", prop: "manageLink", width: 120 };
  const o_7 = { label: "综合可行性", prop: "available" };
  const o_8 = { label: "优先级", prop: "priority" };
  const o_9 = { label: "控制措施", prop: "control", width: 150 };
  const o_10 = { label: "预计节能量", prop: "conservation" };
  const o_11 = { label: "实施部门", prop: "department" };
  const o_12 = { label: "创建时间", prop: "createTime", width: 120 };

  return [o_1, o_2, o_3, o_4, o_5, o_6, o_7, o_8, o_9, o_10, o_11, o_12];
};
